{% extends 'login/base.html' %}
{% include captcha.urls %}
{% load static %}
{% block css %}
    <link href="{% static 'login/css/login.css' %}" rel="stylesheet">
{% endblock %}
{% block title %}
<title>Login</title>
{% endblock %}

{% block content %}
    <div class="container">
        <div class="col">
            <form class="form-login" action="{% url 'login' %}" method="post">

                {% if login_form.captcha.errors %}
                    <div class="alert alert-warning">{{ login_form.captcha.errors }}</div>
                {% endif %}
                {% if message %}
                    <div class="alert alert-warning">{{ message }}</div>
                {% endif %}
                {% csrf_token %}
                <h3 class="text-center">欢迎登录！</h3>

                <div class="form-group">
                    {{ login_form.username.label_tag }}
                    {{ login_form.username }}
                </div>

                <div class="form-group">
                    {{ login_form.password.label_tag }}
                    {{ login_form.password }}
                </div>

                <div class="form-group">
                    {{ login_form.captcha.label_tag }}
                    {{ login_form.captcha }}
                </div>

                <div>
                    <a href="{% url 'register' %}" class="text-success"><ins>新用户注册</ins></a>
                    <button type="submit" class="btn btn-primary float-right">登录</button>
                </div>
            </form>
        </div>
    </div>

{% endblock %}